// PasswordV.h: interface for the CPasswordV class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PASSWORDV_H__590EBBDD_6956_4B1C_80D6_45400D3D20A2__INCLUDED_)
#define AFX_PASSWORDV_H__590EBBDD_6956_4B1C_80D6_45400D3D20A2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Limitation.h"
#include "StorageDatabase.h"

#include "sdbapi.h"
#include "ackeapi.h"

class CPasswordV
	: public CStorageDatabase
{
// Interface
public:
	UINT m_nID;
	enum EAuthResult
	{
		Auth_Pass		= ACKE_ERR_NOERROR,
		Auth_BadCode	= ACKE_ERR_BAD_AUTH_CODE,
		Auth_BadParam	= ACKE_ERR_BAD_PARAM,
		Auth_PassDue,
		Auth_NoPassword	= -2,
	};
	virtual const char* const GetStaticPassword() const =0;
	virtual const EAuthResult Authenticate(const char* const pszPassword) =0;

// Construction/Destruction
public:
	CPasswordV(const UINT& nPasswordID);
	static const CString ID;
	virtual ~CPasswordV();

// Implement
protected:
	virtual inline void Load() =0;
	bool IsValid() const;
	virtual void MakeInValid();
};

#endif // !defined(AFX_PASSWORDV_H__590EBBDD_6956_4B1C_80D6_45400D3D20A2__INCLUDED_)
